home *** CD-ROM | disk | FTP | other *** search
/ PC for Alla 2005 April / PC för Alla 0504.iso / noje / arcade-3.6.exe / tetris.swf / scripts / DefineSprite_65 / frame_2 / DoAction.as
Encoding:
Text File  |  2003-11-29  |  552 b   |  23 lines

  1. _root.pause_btn._visible = _root.quit_btn._visible = false;
  2. name_txt.restrict = "a-z 0-9.:\\-";
  3. name_txt.text = _root.game_so.data.playerName;
  4. Selection.setFocus(name_txt);
  5. Selection.setSelection(name_txt.length,name_txt.length);
  6. ok_btn.onRelease = function()
  7. {
  8.    if(name_txt.length > 0)
  9.    {
  10.       _root.game_so.data.playerName = name_txt.text;
  11.    }
  12.    _root.nextFrame();
  13. };
  14. ok_btn.onKeyDown = function()
  15. {
  16.    if(Key.getCode() == 13)
  17.    {
  18.       Key.removeListener(this);
  19.       this.onRelease();
  20.    }
  21. };
  22. Key.addListener(ok_btn);
  23.